import Vue from 'vue'
import Router from 'vue-router'
import App from '../App'
import Layout from '../common/Layout/Layout.vue'
import login from '../common/Layout/login.vue'

import HelloWorld from '../components/HelloWorld'
import store from '../components/store.vue'
import product from '../components/product.vue'
import vncHtml from '../components/useVncComponent.vue'
import thing from '../components/thingDetail.vue'

import config from '../components/Detail/config.vue'
import trouble from '../components/Detail/troubleshooting.vue'
import snap from '../components/Detail/snapshot.vue'
import log from '../components/Detail/log.vue'

Vue.use(Router)
const router = new Router({
    routes: [
        {
            path: '/',
            component: App,
            children: [
                {
                    path: '/',
                    redirect: '/login',
                },
                {
                    path: '/login',
                    component: login,
                },
                {
                    path: '/home',
                    component: Layout,
                    children: [
                        {
                            path: '',
                            redirect: 'product'
                        },
                        {
                            path: 'hello',
                            component: HelloWorld
                        },
                        {
                            path: 'store',
                            component: store
                        },
                        {
                            path: 'product',
                            component: product
                        },
                        {
                            path: 'vnc',
                            component: vncHtml
                        },
                        {
                            path: 'thing',
                            component: thing,
                            children: [
                                {
                                    path: '',
                                    redirect: 'config'
                                },
                                {
                                    path: 'config',
                                    component: config
                                },
                                {
                                    path: 'trouble',
                                    component: trouble
                                },
                                {
                                    path: 'snapshot',
                                    component: snap
                                },
                                {
                                    path: 'log',
                                    component: log
                                }
                            ]
                        }
                    ]
                },
            ]
        }
    ]
});

export default router;